package cn.dgiot.fd.controller;

import javax.servlet.http.HttpServletResponse;

import cn.dgiot.fd.model.MessageFcdy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;

import cn.dgiot.fd.model.MessageModel;
import cn.dgiot.fd.service.IMessageSendService;

/**
 * [消息]
 * @author
 */
@RestController
@RequestMapping("/message")
public class MessageController {

	@Autowired
	private IMessageSendService messageSendService;
	
	/**
	 * [发送消息]
	 * @param messageModel
	 * @param response
	 * @return
	 */
	@RequestMapping("/sendMessage")
	public String sendMessage(@RequestBody MessageModel messageModel,HttpServletResponse response) {
		return JSON.toJSONString(messageSendService.sendMessage(messageModel));
	}

	/**
	 * [发送消息] 浮冲电压
	 * @param messageFcdy
	 * @param response
	 * @return
	 */
	@RequestMapping("/sendFcdy")
	public String sendFcdy(@RequestBody MessageFcdy messageFcdy, HttpServletResponse response) {
		return JSON.toJSONString(messageSendService.sendFcdy(messageFcdy));
	}
}
